home *** CD-ROM | disk | FTP | other *** search
/ Collection of Internet / Collection of Internet.iso / faq / comp / vxworks_ < prev    next >
Text File  |  1994-03-16  |  70KB  |  1,906 lines

  1. Newsgroups: comp.os.vxworks,comp.answers,news.answers
  2. Path: bloom-beacon.mit.edu!hookup!swrinde!ihnp4.ucsd.edu!library.ucla.edu!csulb.edu!csus.edu!netcom.com!hjb
  3. From: hjb@netcom.com (squeedy)
  4. Subject: comp.os.vxworks Frequently Asked Questions (FAQ) [LONG]
  5. Message-ID: <hjbCMstAs.7w3@netcom.com>
  6. Followup-To: comp.os.vxworks
  7. Summary: This posting contains a list of Frequently Asked
  8.          Questions (and their answers) about VxWorks REALTIME
  9.      Operating System.  It should be read by anyone who wishes to
  10.      post to the comp.os.vxworks newsgroup.
  11. Keywords: vxworks,realtime,faq,kernel,tcp-ip,networking,vme,embedded
  12. Sender: hjb@netcom.com (squeedy)
  13. Reply-To: hjb@netcom.com
  14. Organization: PEACEFUL STAR, Oakland, CA
  15. Date: Thu, 17 Mar 1994 07:40:03 GMT
  16. Approved: news-answers-request@MIT.Edu
  17. Lines: 1886
  18. Xref: bloom-beacon.mit.edu comp.os.vxworks:2443 comp.answers:4197 news.answers:16479
  19.  
  20. Archive-name: vxworks-faq
  21. Maintained-by: hjb@netcom.com
  22. Last-modified: March 15, 1994
  23. Version: 1.4
  24.  
  25. This is the list of frequently asked questions (and their answers) for
  26. the newsgroup comp.os.vxworks. 
  27.  
  28. Where possible, pointers to existing information are included here, rather
  29. than rehashing that information again.
  30.  
  31. If you haven't already done so, now is as good a time as any to read the
  32. guide to Net etiquette which is posted to news.annouce.newusers regularly.
  33. You should be familiar with acronyms like FAQ, FTP and IMHO, as well as know
  34. about smileys, followups and when to reply by email to postings.
  35.  
  36. The FAQ is currently posted to comp.os.vxworks, news.answers and
  37. comp.answers on the 15th of every month.  
  38.  
  39. This FAQ was compiled by hjb@netcom.com using comments by readers of
  40. comp.os.vxworks as well as his own limited knowledge of VxWorks.  Credits
  41. appear at the end.  Comments and indications of doubt are enclosed in []s in
  42. the text.  Each section begins with dashes ("-") on a line of their own,
  43. then the section number.  This should make searching for a specific section
  44. easy.
  45.  
  46. This FAQ is also available via anonymous ftp in:
  47.     rtfm.mit.edu:/pub/usenet/news.answers/vxworks-faq.Z
  48.     ftp.uu.net:/usenet/news.answers/vxworks-faq.Z 
  49.     cs.toronto.edu:/pub/usenet/comp.answers/vxworks-faq.Z
  50.     netcom.com:/pub/hjb/vxfaq
  51.  
  52. -------------------------------------------------------------------------
  53.  
  54.         TABLE OF CONTENTS
  55.  
  56.     1. What is VxWorks? 
  57.     2. Brief History of VxWorks
  58.     3. What are some of the major features of VxWorks?
  59.     4. What are the Latest versions of VxWorks?
  60.     5. Where is the archive site for user-contributed code?
  61.     6. What application notes are available from Wind River?
  62.     7. How can I join the VxWorks user's group?
  63.     8. Is comp.os.vxworks also available via a mailing list?
  64.     9. Can I use gcc or g++ with VxWorks?
  65.     10. Other C/C++ Compiler tools for VxWorks?
  66.     11. Which cross-debuggers can I use with VxWorks?
  67.     12. What are differences between UNIX and VxWorks?
  68.     13. What are the performance/benchmark numbers for WIND kernel?
  69.     14. What are the performance/benchmark numbers for VxWorks TCP/IP?
  70.     15. What is the VxSim VxWorks Simulator?
  71.     16. Can I use one boot EPROM for multiple boards on the same net?
  72.     17. What's the deal with 68881 FPU code in interrupt handlers?
  73.     18. Why does ls() not work on netDrv devices?
  74.     19. Why can't I do ".." at top level directories or NFS mount points?
  75.     20. Why do I have trouble using relative symbolic links with NFS?
  76.     21. X for VxWorks
  77.     22. IEEE-488 (GPIB) driver for VxWorks
  78.     23. How does one disable NFS client caching?
  79.     24. Why doing a lot of slipInit()/slipDelete() cause routing 
  80.         table corruption?
  81.     25. How does one get better network I/O performance?
  82.     26. How does one troubleshoot a backplane driver malfunction?
  83.     27. How do I add select support to my driver?
  84.     28. bind() gets EADDRINUSE, how do I fix it?
  85.     29. Common errors in interrupt handlers with floating point 
  86.         co-proc hardware
  87.     30. Finding entry point of a given module using its name
  88.     31. The problem with irint() in earlier (5.0.2 ?) releases
  89.     32. What are +T, +I thingies in the "i" output?
  90.     33. Gotchas w.r.t watchdogs
  91.     34. Is it possible to delete a memory partition in VxWorks?
  92.     35. rename() does not work in netDrv and nfsDrv filesystems, why?
  93.     36. Free NFS Server for VxWorks
  94.     37. Free SNMP for VxWorks
  95.     38. What third party products are available for VxWorks?
  96.     39. What kind of products have been developed using VxWorks?
  97.     40. A complete list of CPU hardware supported by VxWorks
  98.     41. A complete list of peripheral devices supported by VxWorks
  99.     42. What's with these unbundled "accessories"?
  100.     43. How come my 5.0.2 BSP isn't available in 5.1, damn it?
  101.     44. How much is VxWorks?
  102.     45. What is MicroWorks?
  103.     46. Other Unbundled Products for VxWorks?
  104.     47. How can I find out more about VxWorks?
  105.     48. What other net.resources are available on real-time systems?
  106.     49. How do i use FIONBIO in 5.0.2 when there is no fcntl()?  
  107.     50. Free lex and yacc for use with VxWorks
  108.     51. timer_gettime() bug
  109.     52. bogus INCLUDE_TCP_DEBUG
  110.     53. free ppp for VxWorks
  111.     54. how to disable cache on mc68040 or mc68030 using TT regs?
  112.     55. work-arounds for ms-dos filesystem bug when lseek() past eof
  113.     56. TCL for VxWorks
  114.     57. adding default route
  115.     58. adjusting network driver MTU size
  116. [new]    59. tcpdump like utility for vxworks
  117. [new]    60. VxWorks performance on i960 -- unofficial benchmark
  118. [new]    61. VxWorks SCSI Performance -- unofficial benchmark
  119.     9999. Contributions to comp.os.vxworks FAQs.
  120.  
  121. -------------------------------------------------------------------------
  122.  
  123. 1. What is VxWorks?
  124.  
  125. VxWorks, from Wind River Systems, is a networked real-time operating
  126. system designed to be used in a distributed environment.  It runs on a
  127. wide variety of hardware, including MC680x0, MC683xx, Intel i960, Intel
  128. i386, R3000, SPARC, Fujitsu SPARClite, and TRON Gmicro, based systems. 
  129. It requires a host workstation for program development; supported host
  130. platforms include Sun3, Sun4, HP9000, IBM RS-6000, DEC, SGI, and MIPS. 
  131.  
  132. It does not run development systems software such as compiler, linker
  133. and editor on the target machine.  The development environment is based
  134. on cross-development or remote-development method.  You will need a
  135. UNIX machine of some sort (e.g. SUN's) to run the compilers and
  136. debuggers.  The compiled application code can be downloaded to the
  137. target and runs as part of the VxWorks image.  During the development
  138. phase or thereafter, individual object code (.o files) can be
  139. downloaded dynamically to running target system.  Finished applications
  140. can be ROM'ed or whatever.
  141.  
  142. ----------------------------
  143.  
  144. 2. Brief History of VxWorks
  145.  
  146. Based on what I have heard from David Wilner and others, WRS was
  147. started by Jerry Fiddler and David Wilner in Jerry's garage as a
  148. contract/consultant shop for realtime, embedded systems and other fun
  149. things.  Francis Coppola was one of the earlier customers.
  150.  
  151. They wrote a bunch of neat programs for their work and found that they
  152. liked them a great deal themselves, and added more excellent features
  153. to the system, eventually adding some things unheard of in
  154. embedded/realtime market in those days such TCP/IP networking. And
  155. continued to pioneer in this area by adding NFS, etc.
  156.  
  157. VxWorks was the name given the collection of software which ran on
  158. top of various realtime kernels including VRTX and pSOS as well an
  159. earlier slower version of WIND kernel.  [ editorial:
  160. VxWorks no longer runs on other kernels; it now runs exclusively on 
  161. its own WIND kernel since the 5.0 release, for which the WIND was 
  162. rewritten by John Fogelin. ]
  163.  
  164. They got more people interested in the system and became successful.
  165. And moved from a little building in Emeryville to a larger one. And
  166. eventually to the present site in Alameda.  And hired a  lot of people.
  167.  
  168. WRS sold many many more copies of this system and continues to grow
  169. like a real successful company.
  170.  
  171. -----------------------------
  172.  
  173. 3. What are some of the major features of VxWorks?
  174.  
  175. In Version 5.1:
  176.  
  177.  - wind kernel unlimited tasks
  178.  - 256 priorities
  179.  - binary, counting mutex semaphores
  180.  - message q's
  181.  - POSIX pipes
  182.  - sockets
  183.  - shared memory
  184.  - profiling utilities
  185.  - ethernet support (i596, LANCE, NIC, SONIC)
  186.  - SLIP (no PPP yet)
  187.  - backplane driver for network
  188.  - rlogin (server & client)
  189.  - telnet (server only)
  190.  - rpc (no rpcgen)
  191.  - nfs (client)
  192.  - ftp (server & client)
  193.  - tftp (client & server)
  194.  - rsh
  195.  - bootp
  196.  - proxyarp
  197.  - C-interpreter shell (incomplete but useful)
  198.  - symbolic debugging
  199.  - disassembly
  200.  - performmance monitoring tools
  201.  - exception handling
  202.  - signal handling (not quite unix compatible)
  203.  - dynamic object image loader
  204.  - system symbol table
  205.  - system info utilities
  206.  - libraries of 600+ utility routines
  207.  - remote source level debugger(VxGDB)
  208.  - SCSI support
  209.  - DOS & RT11 & Raw filesystems.
  210.  - "full ANSI"
  211.  - "POSIX I/O"
  212.  
  213. It is a good idea to get a copy of VxWorks manuals before purchasing
  214. the system.  WRS can provide you with such documentation.  As far as I
  215. know there is no "VxBook" in the bookstores.
  216.  
  217. ----------------------------
  218.  
  219. 4. What are the Latest versions of VxWorks?
  220.  
  221. As as of June 1993,
  222.  
  223.      5.0.3.: TRON will be discontinued.
  224.      5.0.3 : i386
  225.      5.0.5 : r3000
  226.      5.1   : 680x0, 683xx, i960, SPARC
  227.      i386 and r3000 will be upgraded to 5.1.
  228.  
  229. ------------------------------
  230.  
  231. 5. Where is the archive site for user-contributed code?
  232.  
  233. The VxWorks archive system is available for FTP as thor.atd.ucar.edu.
  234. It is also accessible via email server at vxworks_archive@ncar.ucar.edu.
  235. Questions should be directed to its maintainer, Richard Neitzel
  236. <thor@thor.ucar.edu>.
  237.  
  238. To get more detailed infomation send email to:
  239.  
  240. vxworks_archive@ncar.ucar.edu
  241.  
  242. The message body must read:
  243.  
  244. send index
  245. send index from vx
  246. send index from unix
  247.  
  248. A summary of the archives is periodically posted to comp.os.vxworks.
  249.  
  250. Some of the usual titles available:
  251.  
  252. ansi, ansilib, benchmarks, bitcnt, c++builtin, c++headers, camaclib, cbench
  253. cntsem_class, crc, deadman, dhrystones, dirlib, dt1451, fcompress
  254. flags_class, force, gcc+68040, getdate, hkv30extintutil, ivecalloc, joblib2
  255. lclflag, libX11, loadmeter, math, monitor, msgque_class, ntpvx, ping, pipe
  256. poolLib, ring, semCnt, ss1, stevie, string, syslog, task_class, taskmon, tod
  257. tp41, ty335, veclist, vtape, vwcurses, vx_cplusplus, vxrsh, wdog_class, shar
  258. vxtool, vxview, xc
  259.  
  260. ------------------------------
  261.  
  262. 6. What application notes are available from Wind River?
  263.  
  264.   List of Wind Technical Notes
  265.  
  266.  Motorola MV147 Slave Base Control       9-1
  267.  System hang during lkup( ) output       10-1
  268.  Reserving Memory                        11-1
  269.  Serial IO Vanishing                     13-1
  270.  NFS: problems with writing files        14-1
  271.  Which interrupts does VxWorks use?      15-1
  272.  Debugging ftp problems                  18-1
  273.  Interrupt handlers, floating point      19-1
  274.  Booting From a Memory Board             22-1
  275.  Changing Network Interfaces             23-1
  276.  Writing Non-buffered Sockets            24-1
  277.  RPC and VxWorks                         25-1
  278.  Using SCSI devices with VxWorks 5.x     26-1
  279.  The Select Facility in VxWorks          28-1
  280.         Using on-board Serial Ports       29-1
  281.         Problems with ls()            30-1
  282.  SCSI                      31-1
  283.  Trouble Shooting Booting Problems       32-1
  284.  
  285. -----------------------------
  286.  
  287. 7. How can I join the VxWorks user's group?
  288.  
  289. For User Group info contact WRS or Eric Rabinowitz of Panoramic Systems at:
  290.  
  291.  elr@netcom.com   or  ericr@wrs.com 
  292.  phone: 408-429-0598
  293.  
  294. ------------------------------
  295.  
  296. 8. Is comp.os.vxworks also available via a mailing list?
  297.  
  298. Lawrence Berkeley Labs maintains an automated mailing list which is
  299. bi-directionally gatewayed to comp.os.vxworks
  300.  
  301. It is called the 'VxWorks Exploder'.
  302.  
  303. Mail to vxwexplo@lbl.gov is automatically mailed to a number
  304. of sites, including Wind River.
  305.  
  306. Send subscription request to vxwexplo-request@lbl.gov.
  307.  
  308. ------------------------------
  309.  
  310. 9. Can I use gcc or g++ with VxWorks?
  311.  
  312. WRS's gcc GNU Toolkit distribution can be reshipped in its entirety. 
  313. WRS charges are for media and support, so obviously copies thereof
  314. don't matter to them.
  315.  
  316. Lots of customers use g++ as provided by the "net" --
  317. see the VxWorks Archive information below.
  318.  
  319. You can get a generic freely distributable GCC/G++ and compile your
  320. code for VxWorks.  Or you can just get a copy from someone who has a
  321. working GCC cross-development setup from WRS.
  322.  
  323. WRS worked with Cygnus to polish up their release of GCC but a generic
  324. GCC distribution works just fine as well.
  325.  
  326. For MC68K targets:
  327.  You can also use native SunOS 4.X cc running on Sun-3's.
  328.  You can also use various other free m68k C compilers
  329.  such as lcc, sozobon, etc. provided that you're willing
  330.  to hack on them.
  331.  
  332. Richard Neitzel (thor@thor.atd.ucar.edu) writes,
  333.  
  334. Thanks to some feedback I've corrected the archive instructions on how to
  335. build gcc, libgcc and libg++ for VxWorks. To make my life simpler the
  336. patches referenced are no longer included in the vx_cplusplus file. Instead
  337. there are now seperate patch files for the effected parts:
  338.  
  339. libg++-2.5-src.patch: Patches libg++/src.
  340. libgcc2-2.5.0.patch: Patch libgccc2.c for gcc-2.5.0.
  341. libgcc2-2.5.2.patch: Patch libgcc2.c for gcc-2.5.2.
  342. libio-2.5.patch: Patch the stream library.
  343.  
  344. See VxWorks Archive information in this FAQ for details on how to 
  345. get these files.
  346.  
  347. ---------------------------------------
  348.  
  349. 10. Other C/C++ Compiler tools for VxWorks?
  350.  
  351. WRS re-sells (re-engineered?) CenterLine cfront product and WindC++
  352. Gateway for CenterLine ObjectCenter. They come with browsers, etc. 
  353. Not free.
  354.  
  355. Wind C++ Gateway for ObjectCenter sold by WRS:
  356.  
  357. $995 / user 1-4 copies
  358. $875 / user 5-9 copies
  359.  
  360. Note that this is the cost over and above ObjectCenter.
  361.  
  362. ------------------------------
  363.  
  364. 11. Which cross-debuggers can I use with VxWorks?
  365.  
  366. GDB & other more expensive tools from WRS, MicroTec Research, etc.
  367.  
  368. WRS sells a lightly modified version of xxgdb which has a lousy GUI
  369. interface.  In 5.1 xvxgdb may have been slightly improved -- but the
  370. ObjectCenter C++ with VxWorks solution provides better GUI interface.
  371.       
  372. With a little bit of hacking, regular GDB works just fine.  Personally,
  373. I find GUI to a debugger gets in the way of real work.  I use GNU Emacs
  374. GDB interface which works well and can be easily customized.
  375.  
  376. There might be some old VxWorks customers that also use VxWorks-aware 
  377. dbxtool on Sun machines.  This used to be maintained and sold by SUN
  378. Consulting.
  379.  
  380. If you're only interested in debugging your "application" on VxWorks,
  381. the vxgdb approach (using RPC) works just fine.
  382.  
  383. If you are rather more interested in the guts of the system as well as
  384. your application you might want to spend some time building
  385. cross-debugging tools from generic GDB distribution into VxWorks.
  386.  
  387. ------------------------------------ 
  388.  
  389. 12. What are differences between UNIX and VxWorks?
  390.  
  391. They're both a hack.  UNIX has a larger installed base. :-)
  392.  
  393. Seriously though, similarities end there, IMHO.  VxWorks does have a lot of
  394. UNIX "compatible" routines in the user libraries.  So porting a UNIX
  395. application is not that hard.  But there are enough differences to make such
  396. a port take longer than normally expected.
  397.  
  398. For one thing, UNIX definitely is not realtime, whatever that means. 
  399. [ editorial: To me personally, what realtime means is this -- when there
  400. is a spinning process or task running like crazy doing some stuff
  401. busily, I still want my system to respond immediately when I type a
  402. character on my console keyboard.  VxWorks, and other real realtime
  403. OS'es, do this.  UNIX and MS-DOG don't. ]
  404.  
  405. VxWorks in its original form does not have any memory protection support.
  406. It runs in one mode.  No protected vs. user mode switching is done.  Running
  407. in supervisor mode on most processors, and not using traps for system calls,
  408. VxWorks can achieve minimal overhead on a given piece of hardware than
  409. UNIX.  Programming on VxWorks can be more tricky than UNIX for the same
  410. reason.
  411.  
  412. UNIX provides resource reclamation; by default, VxWorks does not.  
  413. [ editorial: using deleteHooks or whatever, you could implement
  414. this on your own.]  Instead programmers write what they need as
  415. needed.  As a result, the context switch time in VxWorks is on the
  416. order of a few micro-seconds (since there is a lot smaller context to
  417. save and restore). VxWorks does not have full "process";
  418. it only has tasks, or "threads", or light weight processes as some people
  419. like to call them.
  420.  
  421. Like any other multi-threaded environments (or SMP environments), care
  422. should be taken when writing multi-tasking code.  Each routine should be
  423. written carefully to be re-entrant (if it is going to be called from
  424. multiple contexts), semaphores are used a lot for this. And static variables
  425. are frowned upon.  Sometimes, when porting a UNIX application, you may need
  426. to add "task variables" for this reason (as done for rpcLib in VxWorks).
  427.  
  428. VxWorks: minimal interrupt latency (e.g. spl's are quasi-implemented as
  429. semaphores).  UNIX: ridiculous interrupt latency (e.g. spl's are implemented
  430. as interrupt lock and unlock calls!).
  431.  
  432. VxWorks: priority preemption, optional round-robin time-slicing.  
  433. Traditional UNIX: prioritized round-robin time-slicing.  
  434. Since VxWorks is just a glorified "program" it can be 
  435. changed and customized pretty easily.  Task scheduling can
  436. be customized as desired, for example.  Most people prefer priority based
  437. preemption in the realtime world.  UNIX prefers "fair-share time-slicing".
  438.  
  439. VxWorks networking code, however, is very UNIX compatible [editorial:
  440. it is essentially "ported" version of BSD UNIX TCP/IP code -- tahoe
  441. release ].  It is relatively easy to port socket based code to 
  442. VxWorks.  [ editorial: except the not-so-compatible hostLib routines, etc.]
  443.  
  444. VxWorks most definitely is not a "realtime UNIX", or a varient of UNIX as
  445. often misunderstood by some people.  The confusion perhaps is due to the
  446. fact that UNIX hosts are used most widely to develop applications for 
  447. VxWorks (and VxWorks itself).  [ editorial: Realtime UNIX sounds kind of like
  448. Military Intelligence to me. (can you say, oxymoron?) ;-) ]
  449.  
  450. There are a lot more differences!  In short, UNIX is a nice system to run
  451. emacs on.  VxWorks is much better at playing pin-ball game machines.
  452.  
  453. ----------------------------
  454.  
  455. 13. What are the performance/benchmark numbers for WIND kernel?
  456.  
  457. A WRS VxWorks 5.1 Benchmark Report hot off the press:
  458.  
  459. Benchmark numbers based on: mv167-25Mhz, 5.1
  460.  
  461.                                 Cache    Cache 
  462. Key Measurements                        Enabled    Disabled
  463.  
  464. Raw Context Switch Time                 4 us    14 us
  465. Cyclic Test Time                        172 us  638 us
  466. Suspend/Switch/Resume/Switch                23 us   86 us
  467.  
  468. Kernel Timings
  469.  
  470. Task Related
  471. taskSpawn                           124 us  370 us
  472. taskInit                            58 us   181 us
  473. taskActivate                        12 us   33 us
  474. taskDelete                          101 us  303 us
  475. Task Create / Delete                    249 us  684 us
  476. taskLock
  477.         CASE 1: no lock                 3 us    4 us
  478.         CASE 2: lock exists                 2 us    5 us
  479. taskUnlock
  480.         CASE 1: no lock                 2 us    12 us
  481.         CASE 2: lock exists                 5 us    6 us
  482. taskSuspend
  483.         CASE 1: ready task                  11 us   30 us
  484.         CASE 2: pended task                 9 us    19 us
  485.         CASE 3: suspended task              8 us    19 us
  486.         CASE 4: delayed task                9 us    19 us
  487. taskResume
  488.         CASE 1: ready task                  6 us    19 us
  489.         CASE 2: pended task                 10 us   19 us
  490.         CASE 3: suspended task              13 us   30 us
  491.         CASE 4: delayed task                9 us    18 us
  492.  
  493. Semaphore Related
  494. semBCreate                          66 us   152 us
  495. semCCreate                          46 us   150 us
  496. semMCreate                          45 us   139 us
  497. semDelete
  498.         Binary                      49 us   157 us
  499.         Counting                        49 us   163 us
  500.         Mutual Exclusion                    48 us   157 us
  501. semGive
  502.         CASE 1: tasks in queue  
  503.         Binary                      18 us   44 us
  504.         Counting                        20 us   46 us
  505.         Mutual Exclusion                    25 us   59 us
  506.         CASE 2: no tasks in queue       
  507.         Binary                      4 us    8 us
  508.         Counting                        5 us    11 us
  509.         Mutual Exclusion                    6 us    15 us
  510.  
  511. semTake
  512. CASE 1: semaphore available     
  513.         Binary                      4 us    9 us
  514.         Counting                        5 us    11 us
  515.         Mutual Exclusion                    5 us    13 us
  516.         CASE 2: semaphore unavailable   
  517.         Binary                      10 us   25 us
  518.         Counting                        11 us   27 us
  519.         Mutual Exclusion                    4 us    12 us
  520. Semaphore Give / Take
  521.         Binary                      7 us    15 us
  522.         Counting                        9 us    21 us
  523.         Mutual Exclusion                    10 us   26 us
  524. semFlush
  525.         Binary                      11 us   20 us
  526.         Counting                        11 us   20 us
  527.         Mutual Exclusion                    10 us   16 us
  528.  
  529. Miscellaneous Operating System Timings
  530.  
  531. Message Queue Related
  532. msgQCreate                          93 us   280 us
  533. msgQDelete                          71 us   229 us
  534. msgQSend
  535.         CASE 1: task pending                39 us   102 us
  536.         CASE 2: no tasks pending                23 us   64 us
  537.         CASE 3: queue full                  14 us   45 us
  538. msgQReceive
  539.         CASE 1: message available               20 us   62 us
  540.         CASE 2: message unavailable             15 us   41 us
  541.  
  542. Memory Related
  543. malloc                          28 us   81 us
  544. free                                32 us   104 us
  545.  
  546. Watchdog Related
  547. wdCreate                            42 us   106 us
  548. wdDelete
  549.         CASE 1: timer started               48 us   160 us
  550.         CASE 2: timer not started               44 us   150 us
  551. wdStart
  552.         CASE 1: timer in queue              20 us   70 us
  553.         CASE 2: no timer in queue               18 us   55 us
  554. wdCancel                            11 us   34 us
  555.  
  556. Floating-Point  
  557. robot application                       18 sec  51 sec
  558.  
  559. [ editorial:
  560. If you're anal enough to count pico-seconds in comparing realtime
  561. kernels, you  might want to actually get each of the evaluation copies
  562. from various vendors and test them yourself.  But remember benchmarks
  563. are misleading and almost always biased and inaccurate.  Given similar
  564. benchmark numbers, give or take a few microseconds, etc., your dollars
  565. are better spent in getting something you'll enjoy using. ]
  566.  
  567. -----------------------------
  568.  
  569. 14. What are the performance/benchmark numbers for VxWorks TCP/IP?
  570.  
  571. According to WRS, using VxWorks 5.1 on mv167-25mhz (i82596 ethernet)
  572.  
  573.                  w/ cache      w/o cache enabled
  574.  TCP/IP Throughput (KB/sec)      859 KB/sec      682 KB/sec
  575.  
  576. No numbers available on latency.
  577.  
  578. Using a reasonably fast processor 25Mhz MC68040 and a reasonably well
  579. made ethernet chip like SONIC or LANCE put together on a reasonable board
  580. design will achieve TCP throughput close to full bandwidth of ethernet.
  581.  
  582. [ editorial:
  583. This, of course, is rather slow in comparison with other fast
  584. implementations, since a 16Mhz MC68020 with onboard LANCE 
  585. or a PeeCee with an ethernet board can easily do the same.
  586. I know at least one implementation based on el-cheapo i486-50mhz/EISA/SONIC
  587. that does: 1170KB/sec.  ]
  588.  
  589. ---------------------------------
  590.  
  591. 15. What is the VxSim VxWorks Simulator?
  592.  
  593. Propaganda from WRS:
  594.  
  595.  It really is VxWorks running under UNIX!  So sure it
  596.  is not realtime, although all tasks and resources interact
  597.  in the same way -- great for prototyping "high-level" code.
  598.  Using the simulator saves wear and tear on h/w.  It (only)
  599.  allows sytem level debugging with native GDB.
  600.  
  601.  Portably written object code compiled for VxSim (for SunOS SPARC)
  602.  will usually load without recompilation on a SPARC target.  And,
  603.  BTW under 5.1 switching from one architecture to anthoer really is
  604.  pretty painless.
  605.  
  606. ------------------------------
  607.  
  608. 16. Can I use one boot EPROM for multiple boards on the same net?
  609.  
  610. WRS provides EPROMs with a default bogus bootline, virtually all
  611. boards come with non-valiatile RAM which is set as soon as the user
  612. fills in his parameters (which include CPU #).  Therefore 1 EPROM may
  613. be duplicated and used in all boards at a site.  If the board does not
  614. contain nvram then ROMs have to be specially blown, unless a custom
  615. scheme for reading some switches or something is coded to index into a
  616. bootline table.  In 5.1 BOOTP is supported -- no more repeated EPROM
  617. burning is necessary.
  618.  
  619. ------------------------------
  620.  
  621. 17. What's the deal with 68881 FPU code in interrupt handlers?
  622.  
  623. In general, FP context is optimally saved only when the scheduler
  624. notices that the new task coming in also uses the fpu (VX_FP_TASK).
  625. ISRs don't.  If no tasks are using the FPU then ISRs may go ahead,
  626. unless different levels of ISRs could interrupt each other and again
  627. cause a protocol violation.
  628.  
  629. And Stan Schneider says,
  630.  
  631. You have to set the "VX_FP_TASK" option flag when you spawn your task.  You
  632. also need to make sure you don't use the FPU in any interrupt service
  633. routines.  Even if your code uses no floating point, some (brain-dead)
  634. compilers save some FPU registers at the start of all routines if there's any
  635. floating point in the file.  That's not usually a problem if you're using the
  636. gcc compiler (at least with the "-O" flag on).  A sure way to check is via the
  637. dissassembler.
  638.  
  639. And Leonid Rosenboim says,
  640.  
  641. This problem is quite common, and really simple to fix, all you have to
  642. do is make sure that all tasks that do a float operation ever, will
  643. be spawned with the VX_FP task option set. This is the best and only
  644. solution. Also, if you run floating operations in ISRs care must be taken,
  645. to call fppSave() and fppRestore(). Also if you are using 5.1 on a 68040,
  646. there is a bug in the compiler that you must work around:
  647.  
  648.     If you write an ISR that uses float instructions, it is not
  649.     enougth just to call fppSave()/fppRestore(), since the compiler
  650.     for 68040 inserts FP instructions BEFORE your first line
  651.     of C code, hence you need to write a dummy ISR that:
  652.  
  653.      dummyIsr()
  654.     {
  655.         fppSave( .. );
  656.         yourRealISR();
  657.         fppRestore( ... );
  658.     }
  659.  
  660. And Kent Long says,
  661.  
  662. This was indeed a real problem in the context switch code in 5.0.x which
  663. was corrected in 5.1.
  664.  
  665. In both OS versions, there is an optimization that causes the FP context
  666. to be swapped only when the incoming task has been spawned with the
  667. floating point (VX_FP) flag set.  In 5.0.x, the copying-in of the FP context
  668. was done via an fppSave() call.  This created problems if a new FP
  669. task was created after a previous FP task had been pre-empted by a non-FP
  670. task in the middle of an instruction.  The new task ended up with a 
  671. mid-instruction context (which causes the protocol violation), and the 
  672. old swapped-out FP task ultimately ended up with its context set to IDLE 
  673. (which is equally incorrect).
  674.  
  675. In 5.1, the FP context initialization was changed so that when a task
  676. is created, a pre-defined IDLE frame is copied into that tasks's context.
  677. Since there is no assumption about current FP state (as with fppSave),
  678. task creation is now decoupled from the regular switch logic.
  679.  
  680.  
  681. ------------------------------
  682.  
  683. 18. Why does ls() not work on netDrv devices?
  684.  
  685. Because the way directory information retrieval IOCTL calls are not acompatible
  686. between different types of "filesystems" in VxWorks.  Another reason why
  687. some think VxWorks filesytem does not exist; they're just a collection of
  688. ioDevice drivers, and there is not a real consistent "design" to it.
  689.  
  690. The lsOld() should work on "filesystems" that does not support ls().
  691.  
  692. Chuck Mead proposes the following special routine in case lsOld() does not
  693. work for you:
  694.  
  695.  
  696. #include "vxWorks.h"
  697. #include "bootLib.h"
  698.  
  699. #define RSHD 514
  700.  
  701. STATUS lsHost(path)
  702.    char  *path ;
  703. {
  704.    char *lsString;
  705.    int dataSock ;
  706.    int n ;
  707.    char nextChar ;
  708.  
  709.    extern BOOT_PARAMS sysBootParams ;
  710.    extern char *sysBootHost ;
  711.  
  712.    if (path == (char *) NULL)
  713.    {
  714.       lsString = (char *) malloc(4) ;
  715.       strcpy(lsString, "ls") ;
  716.    }
  717.    else
  718.    {
  719.       lsString = (char *) malloc(strlen(path) + 5) ;
  720.       sprintf(lsString, "%s%s", "ls ", path) ;
  721.    }
  722.  
  723.    dataSock = rcmd (sysBootHost, RSHD, sysBootParams.usr,
  724.         sysBootParams.usr, lsString, (int *) NULL) ;
  725.  
  726.    if (dataSock == ERROR)
  727.    {
  728.       printf("Error opening socket") ;
  729.       return (ERROR) ;
  730.    }
  731.  
  732.    n = fioRead(dataSock, &nextChar, 1) ;
  733.    while (n == 1)
  734.    {
  735.       printf("%c",nextChar) ;
  736.       n = fioRead(dataSock, &nextChar, 1) ;
  737.    }
  738.  
  739.    close(dataSock) ;
  740. }
  741.  
  742. ------------------------------
  743.  
  744. 19.  Why can't I do ".." at top level directories or NFS mount points?
  745.  
  746. Because, again, VxWorks does not really have a "filesystem" as most people
  747. understand it.  The top level directories are just implemented as device
  748. driver "node", which is used to identify the ioDev associated with the
  749. specific VxWorks "filesystem".  Since there is no underlying filesystem
  750. layer, the story ends there.  When you're at the top of the directory
  751. hierarchy within a given ioDev/filesytem, you simply cannot do "..".
  752.  
  753. ------------------------------
  754.  
  755. 20. Why do I have trouble using relative symbolic links with NFS?
  756.  
  757. See [Q: Why can't I do ".." at top level directories or NFS mount points?]
  758. above.  This is just another problem caused by the fact that a real filesystem
  759. does not exist for VxWorks.  NFS client implementation actually does implement
  760. the symbolic links correctly, using lookup and readlink.  The problem is
  761. due to the fact that, for some relative links that use ".." or whatever, that
  762. crosses over filesystems, VxWorks cannot have underlying subsystem that will
  763. handle file pathname to device mapping.  
  764.  
  765. Using absolute symbolic links work just fine (i.e. full path name from top).
  766.  
  767. ------------------------------
  768.  
  769. 21. X for VxWorks
  770.  
  771. WRS has a product called windX which supports Motif. There is also
  772. libX11 contribution in the VxWorks Archive. This package is perhaps
  773. fairly old and out of date. Essentially, to port X stuff to VxWorks
  774. you'll need to do make sure code is re-entrant everywhere.  There is a
  775. "multi-thread" safe version of Xlib available somewhere on the net, one
  776. might try porting that.  There are also vendors that have built X servers
  777. using VxWorks.  Jupiter Systems, in Alameda, makes high-end X server
  778. machines based on VxWorks.  Other X terminal vendors (HP?) also use VxWorks.
  779.  
  780. -----------------------------
  781.  
  782. 22. IEEE-488 (GPIB) driver for VxWorks
  783.  
  784.  - National Instruments has lots of GPIB stuff
  785.  - THEMIS computers has TSVME-409 whic hincludes a GPIB interface.
  786.  - APLABS probably has some GPIB stuff too.
  787.  
  788. -----------------------------
  789.  
  790. 23. How does one disable NFS client caching?
  791.  
  792. VxWorks caches read and write requests in NFS client code.
  793. To completely disable read and write cache, set nfsCacheSize to 0.
  794. To just flush the write cache as needed, use nfsCacheFlush() or
  795. FIOSYNC ioctl().
  796.  
  797. ------------------------------
  798.  
  799. 24. Why doing a lot of slipInit()/slipDelete() cause routing table corruption?
  800.  
  801. This is due to a bug in slipDelete() and/or if_dettach().  slipDelete()
  802. calls if_dettach() to clean up after itself (SLIP network interface driver).
  803. Not only is if_dettach() misspelled, it also doesn't do a complete job.
  804. One deficiency is that it does not delete routes that are pointing to the
  805. interface being deleted.  This is remedied via another function that deletes
  806. all routes for a give netif device driver.  [ ifRouteDelete() ??? ]
  807. slipDelete() does call this routine to delete routes.  Another problem is
  808. that if_dettach() does not delete a pointer to the netif device driver 
  809. structure in the global in_ifaddr linked list.  The in_ifaddr list is
  810. used by the network kernel code to find IP addresses of available network
  811. interfaces, among other things.  This lack of proper cleanup turns out to 
  812. be a rather hard-to-find memory corruption problem in network code, and
  813. usually manifests itself as routing table corruptions.
  814.  
  815. To fix this add the following routine, and call it right after calling
  816. slipDelete:
  817.  
  818. void in_ifaddr_remove(ifp)
  819.         struct ifnet *ifp;  /* ifp = ifunit("sl0") before slipDelete() called */
  820. {
  821.         struct in_ifaddr *ia, *prev_ia;
  822.  
  823.         if (!ifp) 
  824.                 return;
  825.  
  826.         prev_ia = 0;
  827.  
  828.         for (ia = in_ifaddr; ia; ia = ia->ia_next) {
  829.                 if (ia->ia_ifp == ifp) {
  830.                         if (prev_ia)
  831.                                 prev_ia->ia_next = ia->ia_next;
  832.                         else
  833.                                 in_ifaddr = ia->ia_next;
  834.                         return;
  835.                 }
  836.                 prev_ia = ia;
  837.         }
  838. }
  839.  
  840. This, along with the route cleanup, should be incorporated into if_detach().
  841.  
  842. ------------------------------
  843.  
  844. 25. How does one get better network I/O performance?
  845.  
  846. Most of the overhead is due to socket to network core interface overhead.
  847. The copy that happens between the socket layer and network core code
  848. can be avoided by using the routines in uipc_socket.c (as in BSD tahoe
  849. release code available on various archive sites) and using mbufs directly.
  850.  
  851. You can also try using raw etherLib routines.  However, etherLib also
  852. does copying between user application and network driver.
  853.  
  854. If you must use the socket interface (sockLib), make sure you tune the
  855. socket level buffers sizes to optimal values using setsockopt() calls
  856. SO_SNDBUF and SO_RCVBUF.  You might also just try changing the globals
  857. that control the following default parameters to larger numbers (all
  858. the way upto 48K):
  859.  
  860.  tcp_sendspace (default 4K)
  861.  tcp_recvspace (default 4K)
  862.  udp_sendspace (default 2K)
  863.  udp_recvspace (default 4K)
  864.  
  865. To get around extra latency in some cases, you might turn on TCP_NODELAY
  866. option on TCP sockets.
  867.  
  868. ------------------------------
  869.  
  870. 26. How does one troubleshoot a backplane driver malfunction?
  871.  
  872. There are a few rules of thumb:
  873.  
  874.  1) Try the simplest case first -- use polling instead of
  875.     bus or mailbox interrupts and software test-and-set
  876.     instead of hardware test-and-set.  See if this
  877.     works first.  And then try hardware test-and-set
  878.     and then the desired mailbox or bus interrupt.
  879.  
  880.  2) Use bpShow() to see what's up.  Also look for magic code
  881.     0x1234 in share mem area being used for messages,
  882.     and verify heartbeat is being incremented.
  883.     At the "anchor" you should see the magic code (4 bytes)
  884.     followed by a long word which should be incrementing (the
  885.     heartbeat) every second.
  886.  
  887.  3) Verify all memory mapping and make sure there's no
  888.     address conflicts on the bus, and the anchor area is
  889.     properly set up.  If the anchor and ring buffer area
  890.     is on a CPU, make sure the sysLib.c:sysHwInit()
  891.     does the right thing to allow access to on-board memory
  892.     by other CPU's in the chassis.  Be careful, as some
  893.     VxWorks BSP's turn off on-board memory access by other CPU's
  894.     if the CPU is not processor 0.  This should be changed
  895.     if your anchor CPU is not processor 0 (first CPU in
  896.     VME chassis/backplane) -- this is a boot time configuration 
  897.     parameter [ based on the assumption that bpInit() will be done
  898.     by the processor 0 ].
  899.  
  900.  4) Make sure bus controller is functioning properly.
  901.     Some combinations of boards might not work well
  902.     especially if your system controller board
  903.     arbitrates the bus in one way and other boards
  904.     expect to be arbitrated in a different way.
  905.     Sometimes you might need to use a separate
  906.     system controller.  Of course, also make sure
  907.     you only have one bus master.  And that your VME
  908.     bus strappings (BREQ, IACK daisychains) are right.
  909.  
  910.  5) Call Wind River's VxWorks tech-support... 
  911.  
  912. ------------------------------
  913.  
  914. 27. How do I add select support to my driver?
  915.  
  916. #include "selectLib.h"
  917. ...
  918.  
  919. xxx_init(...)
  920. {
  921.      ...
  922.      selWakeupListInit(&xxxdev->selwakeupList);
  923.      ...
  924. }
  925.  
  926. xxx_ioctl(...)
  927. {
  928.      ...
  929.      switch(request_type) {
  930.      ...
  931.      case FIOSELECT:
  932.           selNodeAdd(&xxxdev->selwakeupList,
  933.                (SEL_WAKEUP_NODE *)request_arg);
  934.           if ((selWakeupType((SEL_WAKEUP_NODE*)request_arg) == SELREAD)
  935.                && readable_condition_is_met)
  936.                selWakeup((SEL_WAKEUP_NODE*)request_arg);
  937.           if ((selWakeupType((SEL_WAKEUP_NODE*)request_arg) == SELWRITE)
  938.                && writable_condition_is_met)
  939.                selWakeup((SEL_WAKEUP_NODE*)request_arg);
  940.           break;
  941.      ...
  942.      case FIOUNSELECT:
  943.           selNodeDelete(&xxxdev->selWakeupList,
  944.                (SEL_WAKEUP_NODE*)request_arg);
  945.           break;
  946.      ...
  947.      }
  948. }
  949.  
  950. And, add calls to selWakeup() as appropriate in your interrupt handlers
  951. and read/write routines as selective conditions are toggled or satisfied.
  952.  
  953. ------------------------------
  954.  
  955. 28. bind() gets EADDRINUSE, how do I fix it?
  956.  
  957. Fix: do setsockopt() SO_REUSEADDR
  958.  
  959. ------------------------------
  960.  
  961. 29. Common errors in interrupt handlers with floating point co-proc hardware
  962.  
  963. Don't forget to use:
  964.  fppSave()
  965.  fppRestore()
  966.  
  967. Interrupt handler encapsulation code doesn't always save fpp registers for you.
  968.  
  969. ------------------------------
  970.  
  971. 30. Finding entry point of a given module using its name
  972.  
  973. Example from a poster in vxworks newsgroup (who?):
  974.  
  975.  
  976.  FUNCPTR  start;  /* found entry point goes here */
  977.  UINT8    symType;
  978.  int      tid;
  979.  
  980.  if(symFindByName(sysSymTbl,"_nlos_start",(char**)&start,&symType)==OK){
  981.     /* taskSpawn(name,priority,options,stacksize,entryAddress,arg1,..) */
  982.  
  983.     tid = taskSpawn("nlos",TASK_PRI_NLOS,SPAWN_OPTS,STACK_SIZE_NLOS,start,
  984.     arg1,arg2,.....);
  985.  }
  986.  
  987. ------------------------------
  988.  
  989. 31. The problem with irint() in earlier (5.0.2 ?) releases
  990.  
  991. The problem:
  992.  
  993.  /* Include Files */
  994.  #include "vxWorks.h"
  995.  #include "math.h"
  996.  
  997.  long irint_count = 0;
  998.  
  999.  sinTest()
  1000.  {
  1001.       int sinTable;
  1002.  
  1003.       while(1)
  1004.       {
  1005.            sinTable = irint(sin(4./1024.*(2.*3.14))*10.);
  1006.            irint_count++;
  1007.       }
  1008.  }
  1009.  
  1010.  
  1011.  % cc68k -I/vxworks/vw/h -c sinTest.c
  1012.  
  1013.  -> ld < sinTest.o
  1014.  
  1015.  /* 0x08 Option = VX_FP_TASK within taskLib.h */
  1016.  -> taskSpawn ("sinTest", 100, 0x08, 4000, sinTest)
  1017.  /* OR without the Floating Point Option */
  1018.  -> sp sinTest
  1019.  
  1020.  -> irint_count
  1021.  
  1022.  Bus Error
  1023.  Program Counter: 0xb0ac0124
  1024.  Status Register: 0x3004
  1025.  Access Address : 0xb0ac0120
  1026.  Special Status : 0x01e6
  1027.  Task: 0xfcb82c "sinTest"
  1028.  
  1029. The answer:
  1030.  
  1031. Submitted-by wrs!yuba!kent@uunet.uu.net  Fri Sep 27 18:55:25 1991
  1032. Submitted-by: wrs!yuba!kent@uunet.uu.net (Kent Long)
  1033.  
  1034.  > In the function irint, there is a bug that sets the floating point
  1035.  > Exception enable byte register to random values.  Here is the
  1036.  > disasembled code:
  1037.  >
  1038.  >                         _irint:
  1039.  > 00e034  4e56 0000                LINK  .W    A6,#0
  1040.  > 00e038  f227 6b80                FMOVE .X    F7,-(A7)
  1041.  > 00e03c  f22e 5780 0008           FMOVE .D    ($8,A6),F7
  1042.  > 00e042  f22e 6380 0008           FMOVE .L    F7,($8,A6)
  1043.  > 00e048  202e 0008                MOVE  .L    ($8,A6),D0
  1044.  >
  1045.  > 00e04c  f201 9000                FMOVE .L    D1,#<FPCR>
  1046.  
  1047. <insert audible groan here>
  1048.  
  1049.  > 00e050  504f                     ADDQ  .W    #8,A7
  1050.  > 00e052  4e5e                     UNLK        A6
  1051.  > 00e054  4e75                     RTS
  1052.  >
  1053.  >    Line 0e04c is the line that sets the FPCR to some random value,
  1054.  > as D1 is unknown going into the function.  I rewrote the routine,
  1055.  > without line 0e4c, and everything works fine.
  1056.  >    If anyone out there knows why this line was put in, I would
  1057.  > appreciate knowing.  Hope this may keep someone else from spending
  1058.  > a couple of days tracking down this problem.
  1059.  
  1060. I have confirmed that this is a bug in all 5.x versions of VxWorks for
  1061. the 68k.  (In fact, it's in 4.0.2 as well.)  As Mark correctly observed,
  1062. the problem is that the FPCR register is erroneously being set.
  1063.  
  1064. This was a simple cut-and-paste error in the VxWorks source module.
  1065. The line which sets the FPCR should instead be restoring the value
  1066. of FP7, which was saved on the stack earlier (as you can see in the
  1067. code above).  So, it would appear that another side effect of this
  1068. bug is to clobber FP7.
  1069.   
  1070. The fix is pretty simple.  The following patch scripts should get things
  1071. back to what they should be.  (You can just include the appropriate lines
  1072. in your startup script, or enter them from the VxWorks shell.)
  1073.  
  1074. For VxWorks 5.0.1 and 5.0.2:
  1075.  
  1076.         pMathPatch = mathHardIrint + 0x18;
  1077.         *pMathPatch = (short) 0xf21f;
  1078.         pMathPatch = mathHardIrint + 0x1a;
  1079.         *pMathPatch = (short) 0x4b80;
  1080.  
  1081. This bug does NOT affect VxWorks 5.1.  The disassembled code for Vx5.1,
  1082. (HK68K/V3D) is:
  1083.                         _mathHardIrint:
  1084. 2042e58  4e56 0000                LINK  .W    A6,#0
  1085. 2042e5c  f227 6800                FMOVE .X    F0,-(A7)
  1086. 2042e60  f22e 5400 0008           FMOVE .D    (0x8,A6),F0
  1087. 2042e66  f22e 6000 0008           FMOVE .L    F0,(0x8,A6)
  1088. 2042e6c  202e 0008                MOVE  .L    (0x8,A6),D0
  1089. 2042e70  f21f 4800                FMOVE .X    (A7)+,F0
  1090. 2042e74  4e5e                     UNLK        A6
  1091. 2042e76  4e75                     RTS
  1092.  
  1093. Kent Long further clarifies,
  1094.  
  1095. This was indeed a real problem in the context switch code in 5.0.x which
  1096. was corrected in 5.1.
  1097.  
  1098. In both OS versions, there is an optimization that causes the FP context
  1099. to be swapped only when the incoming task has been spawned with the
  1100. floating point (VX_FP) flag set.  In 5.0.x, the copying-in of the FP context
  1101. was done via an fppSave() call.  This created problems if a new FP
  1102. task was created after a previous FP task had been pre-empted by a non-FP
  1103. task in the middle of an instruction.  The new task ended up with a 
  1104. mid-instruction context (which causes the protocol violation), and the 
  1105. old swapped-out FP task ultimately ended up with its context set to IDLE 
  1106. (which is equally incorrect).
  1107.  
  1108. In 5.1, the FP context initialization was changed so that when a task
  1109. is created, a pre-defined IDLE frame is copied into that tasks's context.
  1110. Since there is no assumption about current FP state (as with fppSave),
  1111. task creation is now decoupled from the regular switch logic.
  1112.  
  1113. ------------------------------
  1114.  
  1115. 32. What are +T, +I thingies in the "i" output?
  1116.  
  1117. The following is an excellent description of all these symbols by many people
  1118. on the net, including "Fred J. Roeber" and others:
  1119.  
  1120. Description                                 Status symbol
  1121. =====================================       ===============
  1122. <blah> and task's priority inherited         <blah> + I                    
  1123. Delayed and suspended                        DELAY+S
  1124. Pended and suspended                         PEND+S
  1125. Pended and Delayed                           PEND+T
  1126. Pended, delayed and suspended                PEND+S+T
  1127.  
  1128. The DELAY state indicates that the task has done some sort of delayed
  1129. call while PEND means the task has done something that caused it to
  1130. block like trying to semTake a semaphore someone else was holding.
  1131. PEND+T means that the task is both delaying and pending; it has done a
  1132. semTake with a timeout. +I means that the task has (temporarily)
  1133. inherited a higher priority through the use of a mutex semaphore.
  1134.  
  1135. The priority inheritance protocol also accounts for the ownership of
  1136. more than one mutual exclusion semaphore at a given time.  A task in
  1137. such a situation will execute at the priority of the highest priority
  1138. task blocked on any of the owned resources.  The task will return to
  1139. its normal, or standard, priority only after relinquishing all of the
  1140. mutual exclusion semaphores with the inversion safety option enabled.
  1141.  
  1142. If you use nested mutex semaphores with priority inheritance turned on then
  1143. when a task inherits a high priority due to some inner semaphore it owns,
  1144. it doesn't lose that priority until it relinquishes all the semaphores it
  1145. holds.  This doesn't quite follow the rules for priority inheritance (to
  1146. the extent that there really are any rules) in that normally, a task's
  1147. inherited priority should decrease as it releases each nested semaphore to
  1148. whatever the priority ceiling is for the semaphores it still holds.  Getting
  1149. this incremental priority reduction to work right in practice, though,
  1150. is extremely difficult (some of the SUN papers on the Solaris real time
  1151. scheduling indicate that this was one of the hardest things for SUN to
  1152. get right in their OS upgrades).  Given that VxWorks is a real time embedded
  1153. OS, I, for one, don't care if WRS uses the current implementation even
  1154. though it isn't "pure" because the result is a more reliable implementation
  1155. that runs more deterministically.  Anyway, my guess is that you will find
  1156. that you have some nested semaphore code where you are doing something
  1157. after releasing one of the nested semaphores that shouldn't be done at a
  1158. high priority.  
  1159.  
  1160. ------------------------------
  1161.  
  1162. 33. Gotchas w.r.t watchdogs
  1163.  
  1164. watchdog handlers run at interrupt level.  You should not use
  1165. routines that can block in interrupt level code.  Frequent mistakes:
  1166. using printf() in watchdog routines -- use logMsg() instead.
  1167.  
  1168. ------------------------------
  1169.  
  1170. 34. Is it possible to delete a memory partition in VxWorks?
  1171.  
  1172. No.  memPartDestroy() is not really implemented.  Perhaps it will
  1173. be in the future.  Currently it just returns ERROR.  
  1174.  
  1175. ------------------------------
  1176.  
  1177. 35. rename() does not work in netDrv and nfsDrv filesystems, why?
  1178.  
  1179. Because rename() is not implemented for netDrv (although it could be),
  1180. and nfsDrv does not implement rename() completely either.
  1181.  
  1182. Talk to WRS to get these fixed.
  1183.  
  1184. ------------------------------
  1185.  
  1186. 36. Free NFS Server for VxWorks
  1187.  
  1188. A free, incomplete, sample implementation (i.e. hack) of NFS Server
  1189. for VxWorks is available in:
  1190.  
  1191.  netcom.com:pub/hjb/nfsd
  1192.  
  1193. There is a README file there that describes further details.  The current
  1194. snapshot of this implementation is a result of a couple of days of 
  1195. hacking, doesn't do everything right, and intended for educational and
  1196. further hacking purpose.
  1197.  
  1198. There is someone else who's porting the MS-DOS PC-based nfs server (SOSS?)
  1199. to VxWorks.  Not clear on its availability yet (let me know!)
  1200.  
  1201. ------------------------------
  1202.  
  1203. 37. Free SNMP for VxWorks
  1204.  
  1205. hoff@bnlux1.bnl.gov (Lawrence T. Hoff) reports,
  1206.  
  1207. We ported the CMU SNMPv2 code to vxWorks 5.1. This latest round of posts has
  1208. prompted me to put it in anonymous ftp (ctrldev1.rhic.bnl.gov --
  1209. 130.199.96.82).
  1210.  
  1211. SNMP Research sells VxWorks compatible port of their SNMP implementation
  1212. with support.  Their's cost $$$$$, though.
  1213.  
  1214. ------------------------------
  1215.  
  1216. 38. What third party products are available for VxWorks?
  1217.  
  1218. I tried to include the third party products, list of consultants,
  1219. services, goodies, etc. available for VxWorks from various sources but...
  1220. there are too many to list here.  Instead,
  1221.  
  1222. the file:
  1223.  
  1224.  netcom.com:pub/hjb/vxworkers
  1225.  
  1226. is updated in realtime to contain a list of individuals and companies
  1227. that offer help, services (paid or unpaid), and goods for VxWorks.
  1228.  
  1229. To get a copy (if you don't have ftp access) or to be listed in this file, 
  1230. please contact or send info in ASCII to:
  1231.  
  1232.  hjb@netcom.com.
  1233.  
  1234. ------------------------------
  1235.  
  1236. 39. What kind of products have been developed using VxWorks?
  1237.  
  1238.  - flight simulators
  1239.  - radio and optical telescopes
  1240.  - automative ABS & realtime suspension
  1241.  - naviation systems
  1242.  - deep sea instrumentation
  1243.  - PBXs
  1244.  - traffic lights
  1245.  - modems
  1246.  - sonar systems
  1247.  
  1248.  [ editorial: And, regrettably, in: ]
  1249.  
  1250.  - military stuff
  1251.  
  1252. ---------------------------------
  1253.  
  1254. 40. A complete list of CPU hardware supported by VxWorks
  1255.  
  1256. Complete list of WRS supported BSP's are available in:
  1257.  
  1258.  netcom.com:pub/hjb/vxbsp
  1259.  
  1260. VxWorks runs on a lot of different hardware.  Majority of hardware
  1261. supported is based on VME bus.  Porting VxWorks to a new VME board
  1262. based on MC68K takes only a few days, give or take a week, depending
  1263. on your karmic condition at the time.  A lot of the ports are
  1264. initially done by the customers and later "approved" by WRS, for
  1265. which they charge, in order to keep them on "supported" list.
  1266.  
  1267. Porting to a new "architecture" (new processor) takes longer.
  1268. This varies more widely -- from a few months to a few years.
  1269.  
  1270. ---------------------------------
  1271.  
  1272. 41. A complete list of peripheral devices supported by VxWorks
  1273.  
  1274. Complete list of WRS supported BSP's are available in:
  1275.  
  1276.  netcom.com:pub/hjb/vxbsp
  1277.  
  1278. VxWorks supports a wide variety of devices.  A lot of device drivers 
  1279. are written both by customers and WRS staff.  There are device drivers
  1280. for almost popular available ethernet chips (except perhaps SEEQ and
  1281. Fujitzu, etc.), various serial chips (MC68681 DUART, Zilog 8350 Sync/Async
  1282. COMM chip, etc.), little I/O thingies in micro-controllers (MC68302
  1283. serial I/O, etc.), SCSI, etc.
  1284.  
  1285. Customers of VxWorks, hackers and other hardware vendors (especially
  1286. VME) usually have a VxWorks driver for their board.  There are drivers
  1287. for FDDI boards, GPIB boards, A/D D/A boards, Graphics controllers,
  1288. frame grabbers, stepper motors, pin-ball machines, and etch-a-sketch
  1289. toy games.
  1290.  
  1291. A list of available device driver for VxWorks can be found in:
  1292.  
  1293.  netcom.com:pub/hjb/vxdrivers
  1294.  
  1295. Some evil VxWorkers have drivers for military/weapons systems.
  1296.  
  1297. ----------------------------------
  1298.  
  1299. 42. What's with these unbundled "accessories"?
  1300.  
  1301. Propaganda from WRS:
  1302.  
  1303.  The new product/feature doesn't need to wait for the
  1304.  next OS release.  Only the users who want/need it pay for it 
  1305.  lengthens price list which keeps individual items lower
  1306.  but still enhances WRS revenue growth.
  1307.  
  1308.  Please Note:
  1309.  WRS still always adds features to the core product, and
  1310.  has never taken items out of core product to make them
  1311.  unbundled.  Unlike UNIX vendors and others.
  1312.  
  1313. -----------------------------------------
  1314.  
  1315. 43. How come my 5.0.2 BSP isn't available in 5.1, damn it?
  1316.  
  1317. Propaganda from WRS:
  1318.  
  1319.  WRS tries to give customers 1 year warning when any product
  1320.  may be discontinued.  Unfortunately, all the bugs in
  1321.  the notification system are still to be worked out.
  1322.  Complain vehemently to your sales rep. if he didn't
  1323.  keep you informed.  WRS BSP obsoletion policy is primarily
  1324.  based on BSP volume and h/w avalability.
  1325.  
  1326. The 5.1 Guide and Release Notes provide a step by step recipe to
  1327. upgrade from 5.0.2 -- minimal changes,  start by ANISifying.  The BSP
  1328. Port Kit 1.1 provides extensive  info for the masochist.
  1329.  
  1330. ----------------------------------------
  1331.  
  1332. 44. How much is VxWorks?
  1333.  
  1334.  In general: Not free, in fact, quite the opposite.
  1335.  
  1336.  - Development License $23.5K (per project?)
  1337.  - Source $120K.
  1338.  - Target Licenses from $1000 for single quantity to $10 for 100,000+.
  1339.  
  1340. ------------------------------
  1341.  
  1342. 45. What is MicroWorks?
  1343.  
  1344. VxWorks is also available as a kernel-only product (MicroWorks 1.0) for
  1345.  the following processors:
  1346.  
  1347.  i960, 680x0, 683xx
  1348.  
  1349. MicroWorks is -- half the product at a half the price.
  1350.  
  1351. It has no network, native debug, shell, or profiling.  Comes with
  1352. VxMon a very portable ROM monitor to talk with an enhanced vxGDB 2.0
  1353. also included -- this is the debug agent which allows true system
  1354. level debugging in ISR or wherever.  In future, VxWorks may also be
  1355. able to work with VxMon.
  1356.  
  1357. Development License $12,500.
  1358.  
  1359. ------------------------------------
  1360.  
  1361. 46. Other Unbundled Products for VxWorks?
  1362.  
  1363. Other unbundled "accessory" products are: VxMP ($4K) which is an
  1364. extended shared memory capabilities for the kernel allowing semaphores
  1365. and other objects to be manipulated over the backplane transparently
  1366. (really!).
  1367.  
  1368. VxVMI ($3K) is a library of virtual memory interface routines allowing
  1369. text & kernel data protection.  complementary products: BSP Port Kit
  1370. 1.1 ($2K), VxSim 1.0 ($5K), WindX ($3.5K), WindC++ ($2.5K), WindC++
  1371. Gateway for ObjectCenter ($?K's), and Realtime Innovations StethoScope (3K).
  1372.  
  1373. ----------------------------- 
  1374.  
  1375. 47. How can I find out more about VxWorks?
  1376.  
  1377.  Read: comp.os.vxworks
  1378.  Email: inquiries@wrs.com
  1379.  Call: 1-800-KIK-WIND
  1380.  
  1381. ------------------------------
  1382.  
  1383. 48. What other net.resources are available on real-time systems?
  1384.  
  1385. There is at least one other newsgroup devoted exclusively to a particular
  1386. vendor's real-time operating system:
  1387.  
  1388. comp.os.os9  Discussions about the OS/9 operating system.
  1389.  
  1390. Here are some other related newsgroups:
  1391.  
  1392. comp.arch        Computer architecture.
  1393. comp.arch.bus.vmebus    Hardware and software for VMEbus Systems.
  1394. comp.os.misc        General OS-oriented discussion not carried elsewhere.
  1395. comp.realtime        Issues related to real-time computing.
  1396. comp.os.os9        Issues related to OS9 and OS9000 realtime OS.
  1397.  
  1398. There are too many other newsgroups devoted to computer operating systems
  1399. to list here.  The interested reader is advised to check the "newsgroups"
  1400. file on a local news service machine.
  1401.  
  1402. The automatic server for users of pSOS RTOS is now in place.
  1403.  
  1404. PSOSUSER - A list intended for the discussion of topics relating to
  1405.            pSOSystem and other products of Integrated Systems Inc.,
  1406.            Software Components Group.
  1407.  
  1408. Send articles to psosuser@isi.com and administrative requests to
  1409. listserver@isi.com.
  1410.  
  1411. If you aren't already subscribed and would like to, please send a mail
  1412. message to listserv@isi.com containing the following in the body of
  1413. the message
  1414.  
  1415. SUBSCRIBE PSOSUSER <substitute your full name here>
  1416.  
  1417. ------------------------------
  1418.  
  1419. 49. How do i use FIONBIO in 5.0.2 when there is no fcntl()?  
  1420.  
  1421. Use ioctl() instead.
  1422.  
  1423. ...
  1424. {
  1425.     ...
  1426.     int on = 1;    /* turn it on */
  1427.     ...
  1428.     ioctl(fd, FIONBIO, &on);
  1429.     ...
  1430. }
  1431.  
  1432. ------------------------------
  1433.  
  1434. 50. Free lex and yacc for use with VxWorks
  1435.  
  1436. John Winas (winas@phebos.aps.anl.gov) writes,
  1437.  
  1438. I just (moments ago) uploaded the two packages to thor.ncar.ucar.edu where
  1439. the vxWorks archive is.  When ever the maintainer moves it into the release
  1440. area they will be available to everyone.  I named the file lexyacc.tar.Z
  1441. and it contains all of the sources and make files for you to build them.
  1442. It all seems to work perfectly on my sun sparc running 4.1.3.  The
  1443. only thing you have to configure is the full path name to where you wish
  1444. to keep flex so that it can find its skeleton file when you use it to
  1445. lexify your .l files.  Byacc has no skeleton files and simply needs to 
  1446. be in your path.
  1447.  
  1448. This file is now available in:
  1449.  
  1450.     epics.aps.anl.gov:/pub/lexyacc.tar.Z
  1451.  
  1452. I am interested in any bugs found in because we are using them here.  Feel
  1453. free to email me at winans@phebos.aps.anl.gov.
  1454.  
  1455. ------------------------------
  1456.  
  1457. 51. timer_gettime() bug
  1458.  
  1459. From: kent@wrs.com (Kent Long)
  1460.  
  1461. In article <9311230139.AA21147@focal.com> bobk@focal.com (Bob Klawuhn) writes:
  1462. >I am currently trying to user the timerLib to obtain
  1463. >the amount of time that a timer has left before it
  1464. >expires. I am trying to use the timer_gettime function. 
  1465. >The value that it seems to return is always the time
  1466. >that the start timer was given, not what is left on the
  1467. >timer.
  1468.  
  1469.  
  1470. This is indeed a bug in the 5.1 and 5.1.1 VxWorks versions.
  1471. It is now being tracked as WRS SPR #2673.
  1472.  
  1473. As a workaround, the following could be done following the
  1474. timer_gettime() call, to convert the erroneous results into
  1475. the desired remainder value:
  1476.  
  1477.  
  1478.      #include "private/timerLibP.h"
  1479.      struct timespec timeNow;
  1480.  
  1481.      (void) clock_gettime (CLOCK_REALTIME, &timeNow);
  1482.      TV_SUB (timerid->exp.it_value, timeNow);
  1483.  
  1484. ...which leaves the remainder in it_value.
  1485.  
  1486. ------------------------------
  1487.  
  1488. 52. bogus INCLUDE_TCP_DEBUG
  1489.  
  1490. From: hipp@wrs.com (Emily Hipp)
  1491.  
  1492. >Bus Error
  1493. >Program Counter: 0x0001c738
  1494. >Status Register: 0x3000 
  1495. >Access Address : 0xbfbfbfd3
  1496. >Special Status : 0x0505
  1497. >Task: 0x3dcc54 "tExcTask"
  1498. >TCP tracing not enabled (use INCLUDE_TCP_DEBUG).  
  1499.  
  1500. This is misleading information.  INCLUDE_TCP_DEBUG is not supported
  1501. as a configAll.h include option.
  1502.  
  1503. [ editorial: 
  1504.   INCLUDE_TCP_DEBUG never got integrated into VxWorks config files.
  1505.   To get around this bug, until WRS fixes it, either unset SO_DEBUG 
  1506.   socket option using getsockopt()/setsockopt(), or call tcpTraceInit() (sp?)
  1507.   which will drag in tcp_debug.o and set the tcp_trace() routine to
  1508.   be called when debug option is set on TCP sockets.
  1509. ]
  1510.  
  1511. ------------------------------
  1512.  
  1513. 53. free ppp for VxWorks
  1514.  
  1515. Is available via anonymous ftp 
  1516.  
  1517.     netcom.com:pub/peacefulstar/dab/vpppd-1.0.tar.gz
  1518.  
  1519. ------------------------------
  1520.  
  1521. 54. how to disable cache on mc68040 or mc68030 using TT regs?
  1522.  
  1523. [ From: Steve Morris <morriss@smtplink.indigo.co.il> ]
  1524.  
  1525.         /**************************/
  1526.         /* for 68030 (e.g. mv147) */
  1527.         /**************************/
  1528.         
  1529.         /* 2 large areas, R/W, cache disabled */
  1530.         #define TT0_VALUE   0x403f8507  /* from $40000000 -> $77ffffff */
  1531.         #define TT1_VALUE   0x03018507  /* from $02000000 -> $03ffffff */
  1532.         
  1533.         test_tt ()
  1534.         {
  1535.             register int *pVal;
  1536.             int ttVal;
  1537.             
  1538.             pVal = &ttVal;
  1539.             
  1540.             ttVal = TT0_VALUE;
  1541.             asm ("pmove %0,tt0" : : "g" (*pVal));
  1542.             ttVal = TT1_VALUE;
  1543.             asm ("pmove %0,tt1" : : "g" (*pVal));
  1544.         }
  1545.         
  1546.         /**************************/
  1547.         /* for 68040 (e.g. mv167) */
  1548.         /**************************/
  1549.         
  1550.         /* 2 large areas, R/W, cache disabled */
  1551.         #define TT0_VALUE   0x403f8507  /* from $40000000 -> $77ffffff */
  1552.         #define TT1_VALUE   0x03018507  /* from $02000000 -> $03ffffff */
  1553.         
  1554.         test_dtt ()
  1555.         {
  1556.             asm ("movec %0,dtt0" : : "r" (DTT0_VALUE));
  1557.             asm ("movec %0,dtt1" : : "r" (DTT1_VALUE));
  1558.         }
  1559.  
  1560. ------------------------------
  1561.  
  1562. 55. work-arounds for MS-DOS filesystem bug when lseek() past eof
  1563.  
  1564. [From: georg@sgl.ists.ca (Georg Feil)] 
  1565.  
  1566. [editorial: This is a workaround for the bug in VxWorks ms-dos
  1567. implementation which produces incorrect error return on write() after
  1568. lseek() beyond eof.  N.B.: VxWorks versions upto 5.1.1 have buggy IO
  1569. system layer that does not support "correct" write() to normal files.
  1570. When writing to a file via write() expect to check the return value
  1571. even if it is not ERROR. Unlike most other systems (e.g. UNIX) VxWorks
  1572. write() upto version 5.1.1 will return number of bytes actually written
  1573. even when write() was not completely successful on devices that are
  1574. not marked non-blocking and/or are subject to flow control. ]
  1575.  
  1576. There's been enough heated debate on this so I'm sending out my brute force
  1577. workaround. Thanks to Kent Long who managed to let slip enough information
  1578. on the bug to identify the prerequisite: lseek() past the end of file.
  1579.  
  1580. My workaround simply extends a file by writing 0's on the end whenever there
  1581. is a seek past the end. (This may result in a file being extended when it
  1582. shouldn't have been, i.e. no write follows the seek, but what the hell.)
  1583. Use file_seek() below instead of lseek() to seek. Note that file_seek() is
  1584. not meant to be plug-replaceable with lseek(), that feature is not
  1585. required in our system. 'zero8k' is a character array of 8192 zero bytes.
  1586.  
  1587.  
  1588. int file_seek(int fd, int offset)
  1589. /*
  1590.  * Sets the byte offset for the next write or read from a file.
  1591.  * Simple interface to lseek() function. This returns ERR_NONE iff the actual
  1592.  * actual seek offset returned by lseek() exactly matches the desired offset.
  1593.  * 'fd' is the file descriptor to seek on.
  1594.  * 'offset' is the absolute file position to seek to in bytes, where 0 is
  1595.  *          the beginning of file.
  1596.  * Return value is error code (not a VxWorks error code, another type).
  1597.  */
  1598. {
  1599.    STATUS st;
  1600.    struct stat filestat;        /* file status info obtained from fstat() */
  1601.    int aoff;        /* actual seek offset returned by lseek() */
  1602.    long int fillsz;    /* (***) for SPR #2739 kludge */
  1603.    long int fillamt;   /* (***) for SPR #2739 kludge */
  1604.  
  1605.    if (FileDebug && Verbose>=2)  {
  1606.       wprintw(interact,"file_seek(): seeking to offset %d on fd %d\n",
  1607.                                                                   offset,fd);
  1608.    }
  1609.  
  1610.    /* (***) workaround for VxWorks 5.1.1 bug SPR #2739 (write() returns with
  1611.         transfer count too low but errno not set after seeking past current
  1612.         end of file). Note that this may extend the file prematurely, i.e.
  1613.         even if no write() calls follow the seek. */
  1614.    /* get current file size */
  1615.    st=fstat(fd, &filestat);
  1616.    if (st==VX_ERROR)  {
  1617.       if (Verbose>0)  {
  1618.          wprintw(interact,"file_seek(): Error performing fstat() on fd %d: %s\n",
  1619.                                                            fd, vw_errmsg(0));
  1620.       }
  1621.       return(ERR_VXIO);
  1622.    }
  1623.  
  1624.    /* manually extend file using zero writes if seek offset past end of file
  1625.         (note: tried ioctl() with FIOTRUNC, but this only works to shorten
  1626.         files! */
  1627.    if (offset>filestat.st_size)  {
  1628.       /* seek to the end of the file first */
  1629.       errno=0;
  1630.       aoff=lseek(fd, filestat.st_size, SEEK_SET);
  1631.       if (aoff != filestat.st_size)  {
  1632.          /* returned value should always match 'filestat.st_size' */
  1633.          if (Verbose>0)  {
  1634.             wprintw(interact,"file_seek(): Incorrect actual file position after seeking to EOF on fd %d (%d, should be %d) (%s)\n",
  1635.                                      fd, aoff, filestat.st_size, vw_errmsg(0));
  1636.          }
  1637.          return(ERR_VXIO);
  1638.       }
  1639.  
  1640.       /* fill file with zeroes to bring length up to 'offset' */
  1641.       fillsz=offset-filestat.st_size;
  1642.       while (fillsz>0)  {
  1643.          if (fillsz>8192)
  1644.             fillamt=8192;
  1645.          else 
  1646.             fillamt=fillsz;
  1647.  
  1648.          errno=0;
  1649.          aoff=write(fd, zero8k, fillamt);
  1650.          if (aoff == VX_ERROR)  {
  1651.             if (Verbose>0)  {
  1652.                wprintw(interact,"file_seek(): Error writing zeros to %d at pos %d: %s\n",
  1653.                                        fd, ioctl(fd,FIOWHERE,0), vw_errmsg(0));
  1654.             }
  1655.             return(ERR_VXIO);
  1656.          }
  1657.  
  1658.          if (aoff != fillamt)  {
  1659.             if (Verbose>0)  {
  1660.                wprintw(interact,"file_seek(): Bad xfer count writing zeros to fd %d at pos %d (%d, should be %d): %s\n",
  1661.                        fd, ioctl(fd,FIOWHERE,0), aoff, fillamt, vw_errmsg(0));
  1662.             }
  1663.             return(ERR_VXIO);
  1664.          }
  1665.  
  1666.          fillsz -= fillamt;
  1667.       }
  1668.  
  1669.       /* flush the output to disk immediately */
  1670.       st=ioctl(fd, FIOFLUSH, 0);
  1671.       if (st!=VX_OK)  {
  1672.          if (Verbose>0)  {
  1673.             wprintw(interact,"file_seek(): Error flushing zeros written to fd %d at pos %d: %s\n",
  1674.                                        fd, ioctl(fd,FIOWHERE,0), vw_errmsg(0));
  1675.          }
  1676.          return(ERR_VXIO);
  1677.       }
  1678.    }
  1679.  
  1680.    /* (***) end of workaround for VxWorks 5.1.1 bug SPR #2739 */
  1681.  
  1682.  
  1683.    errno=0;
  1684.    aoff=lseek(fd, offset, SEEK_SET);
  1685.    if (aoff == VX_ERROR)  {
  1686.       if (Verbose>0)  {
  1687.          wprintw(interact,"file_seek(): Error seeking to offset %d on fd %d: %s\n",
  1688.                                                      offset, fd, vw_errmsg(0));
  1689.       }
  1690.       return(ERR_VXIO);
  1691.    }
  1692.  
  1693.    /* returned value should always match 'offset' */
  1694.    if (aoff != offset)  {
  1695.       if (Verbose>0)  {
  1696.          wprintw(interact,"file_seek(): Incorrect actual file position after seeking on fd %d (%d, should be %d) (%s)\n",
  1697.                                              fd, aoff, offset, vw_errmsg(0));
  1698.       }
  1699.       return(ERR_VXIO);
  1700.    }
  1701.  
  1702.    return(ERR_NONE);
  1703. }
  1704.  
  1705. ------------------------------
  1706.  
  1707. 56. TCL for VxWorks
  1708.  
  1709. [From: vanandel@rsf.atd.ucar.edu (Joe Van Andel)]
  1710.  
  1711. Tool Command Language, version 7.0 (TCL7.0) for VxWorks 5.1 is
  1712. on thor.atd.ucar.edu:~ftp/pub/vx/tclvx7.0.v4.tar.gz
  1713.  
  1714. If you've ever been frustrated that the VxWorks shell is not re-entrant, 
  1715. and has no control flow (e.g. if then else, switch, case ),
  1716. then you will find TCL very useful since it is a very complete language,
  1717. that allows you to add your own application specific commands to
  1718. the interpreter.
  1719.  
  1720. I find it invaluable for system testing, since I register TCL commands for
  1721. all major functionality of my real-time application.  This allows me
  1722. to test most pieces of my data acquisition system from a command line,
  1723. and build nice flexible scripts to test and operate my system.  As a
  1724. matter of fact, I can even invoke specific methods of C++ classes via
  1725. TCL.
  1726.  
  1727. Also, you can control your real-time system from a Unix workstation by
  1728. sending TCL commands from either a TCL or Tk/TCL application (via
  1729. tclTCP).  I find that sending TCL commands (which are just strings) is
  1730. much easier and more flexible than writing a Remote Procedure Call
  1731. (RPC) for each piece of functionality that I need to remotely invoke.
  1732.  
  1733. ------------------------------
  1734.  
  1735. 57. adding default route
  1736.  
  1737. A default route is a route table entry with destination field set to 0.
  1738. To do the equivalent of "route add default gateway metric" in VxWorks,
  1739. do:
  1740.     routeAdd("0",addr_of_gateway);
  1741.  
  1742. ------------------------------
  1743.  
  1744. 58. adjusting network driver MTU size
  1745.  
  1746. VxWorks network driver are compatible (mostly) with tahoe BSD drivers.
  1747. To change MTU you should modify "if_mtu" field of "struct ifnet" you
  1748. pass to ether_attach() or if_attach().
  1749.  
  1750. ------------------------------
  1751.  
  1752. 59. tcpdump like utility for vxworks
  1753.  
  1754. Take a look at a hacked up packet trace program in:
  1755.  
  1756.     netcom.com:/pub/hjb/vxsniff.c
  1757.  
  1758. [editorial: if you have something better, let me know]
  1759.  
  1760. ------------------------------
  1761.  
  1762. 60. VxWorks performance on i960 -- unofficial benchmark
  1763.  
  1764. [ From: djanssen@mswe.dnet.ms.philips.nl (Ton Janssen, 62203 (TSSW)) ]
  1765.  
  1766. We did some measurements on a Heurikon HK80/V960E.
  1767. Equiped with I960CA on 33MHz. Here they are:
  1768.  
  1769. Test-item            Conditions            Time in us
  1770. ==========================================================================
  1771. - semGive/semTake pair        (binary semaphore)        11,2
  1772. - taskSpawn            (+/- 8 processes active)       790,0
  1773. - taskIdVerify                             0,72
  1774. - taskSuspend/taskResume pair    (+/- 8 processes active)    32,6
  1775. - lstAdd/lstDelete pair        (10 nodes in list)         3,9
  1776. - msgQNumMsgs                             1,2
  1777. - msgQReceive             (NOWAIT, no message available)    16,8
  1778. - rngBufPut/rnBufGet pair    (0x20 bytes)            24,5
  1779. - msgQSend/msgQReceive pair    (NOWAIT, no arguments)        65,7
  1780. - bcopy                (Quad aligned data)         0,515/Quad
  1781. - mutliply two floats        (depends on the value!)         1,6
  1782. - multiply two doubles        (   ''     ''    )         2,6
  1783. - Raw context switch        (8 processes active)        34,0
  1784.  
  1785. ------------------------------
  1786.  
  1787. 61. VxWorks SCSI Performance -- unofficial benchmark
  1788.  
  1789. [ From: mea@mclean.sparta.com (Mike Anderson) ]
  1790.  
  1791. System     : Heurikon HK68G/V4D  
  1792.              (33 MHz 68040, 16 MB RAM, NCR53C710 SCSI 
  1793.               w/ Hk SCSI DMA routines in Asynchronous SCSI mode)
  1794.  
  1795. VxWorks    : 5.1.1 (Yes, using Heurikon VxWorks 5.1 BSP)
  1796.  
  1797. Disk       : Seagate ST11200N (1 GB SCSI)
  1798.  
  1799. File System:  VxWorks RAW partition mounted as "/sd1/"
  1800.  
  1801. Clock Rate :  60 Hz
  1802.  
  1803. Approach: 
  1804.  
  1805.   My application has the data coming in in 16Kbyte chunks.  So, I devised
  1806. a piece of test code that would allow me to specify how many 16K chunks
  1807. I sent to the disk in each write and how many total bytes to write.
  1808. The actual number of bytes written is generally a little larger
  1809. (typically one more block size) due to the quick and dirty way I wrote
  1810. the code, but the calculations are based on the actual number of bytes
  1811. written to the disk.  The technique I used was to write a block to the
  1812. disk starting at the end of the last write and then seek back to
  1813. relative zero and write the current pointer (just as I would in real
  1814. life to know how many bytes had been streamed total).  Also, you 
  1815. may notice the disk seek time coming into effect in the 200MByte files.
  1816.  
  1817. Here are the results:
  1818.  
  1819. Buffer Size     Total Requested     Bytes/sec       total secs
  1820. 16K             1024000 (1 MB)      1,032,192       1.000   secs
  1821.                10240000 (10 MBs)    1,036,087       9.883   secs
  1822.               102400000 (100 MBs)   1,049,538      97.566   secs
  1823.               204800000 (200 MBs)   1,043,123     196.333   secs
  1824.  
  1825. 32K             1024000             1,613,193       0.650   secs
  1826.                10240000             1,627,997       6.300   secs
  1827.               102400000             1,627,980      62.900   secs
  1828.               204800000             1,610,485     127.166   secs
  1829.  
  1830. 48K             1024000             1,935,360       0.533   secs
  1831.                10240000             1,994,712       5.150   secs
  1832.               102400000             1,992,209      51.416   secs
  1833.               204800000             1,970,335     103.950   secs
  1834.  
  1835. 64K             1024000             2,169,467       0.483   secs
  1836.                10240000             2,244,905       4.583   secs
  1837.               102400000             2,246,332      45.600   secs
  1838.               204800000             2,216,450      92.400   secs
  1839.  
  1840. 96K             1024000             2,495,409       0.433   secs
  1841.                10240000             2,580,480       4.000   secs
  1842.               102400000             2,571,534      39.833   secs
  1843.               204800000             2,533,374      80.866   secs
  1844.  
  1845. 128K            1024000             2,621,440       0.400   secs
  1846.                10240000             2,761,250       3.750   secs
  1847.               102400000             2,771,147      36.983   secs
  1848.               204800000             2,726,693      75.133   secs
  1849.  
  1850. 256K            1024000             2,859,752       0.366   secs
  1851.                10240000             3,130,077       3.350   secs
  1852.               102400000             3,139,304      32.650   secs
  1853.               204800000             3,083,428      66.483   secs
  1854.  
  1855. 512K            1024000             3,145,728       0.333   secs
  1856.                10240000             3,346,519       3.133   secs
  1857.               102400000             3,361,846      30.566   secs
  1858.               204800000             3,298,416      62.150   secs
  1859.  
  1860. 1024K           1024000             3,311,292       0.316   secs
  1861.                10240000             3,475,942       3.016   secs
  1862.               102400000             3,487,345      29.466   secs
  1863.               204800000             3,416,806      60.150   secs
  1864.  
  1865. ------------------------------
  1866.  
  1867. 9999: Contributions to comp.os.vxworks FAQs.
  1868.  
  1869. The following net.folks, among others, have contributed to this posting:
  1870.  
  1871.  Name            email address
  1872.  ------------        ----------------------------    
  1873.  Mark Linimon         linimon@nominil.lonestar.org
  1874.  Geoff Espin        geoff@wrs.com
  1875.  Rev. Bob Crispen    crispen@foxy.boeing.com
  1876.  Stan Schneider        stan@rti.com
  1877.  Fred J Roeber        fjr@ssd.ray.com
  1878.  Marc Friedman        maf@verdix.com
  1879.  Joe Van Andel        vanandel@ncar.ucar.edu
  1880.  Bob Marino        ram@mr.picker.com
  1881.  Richard Kowalsky    cmdorat@tc.fluke.com 
  1882.  Kent Long        kent@wrs.com
  1883.  James Moore        james@wrs.com
  1884.  Chuck Meade        chuckm@verdix.com
  1885.  Patrick T. Pinkowski    ppinkow@jupiter.ksc.nasa.gov
  1886.  D'Anne Thompson    dat@noao.edu
  1887.  Leonid Rosenboim    leonid@rst.hellnet.org
  1888.  David Lim        lim@robotics.jpl.nasa.gov
  1889.  Richard Neitzel    thor@thor.atd.ucar.edu
  1890.  John Winas        winas@phebos.aps.anl.gov
  1891.  Georg Feil        georg@sgl.ists.ca
  1892.  Steve Morris        morriss@smtplink.indigo.co.il
  1893.  Don Brooks        dab@netcom.com
  1894.  Ton Janssen        djanssen@mswe.dnet.ms.philips.nl
  1895.  
  1896. I welcome flames, insults, accusations, reactions, additions, and
  1897. corrections to this posting via email:
  1898.  
  1899.  Hwa-Jin Bae
  1900.  PEACEFUL STAR
  1901.  hjb@netcom.com 
  1902.  
  1903. ------------------------------
  1904.  
  1905. ===============================================================================
  1906.